import java.util.Scanner;

/**
 * Created by dllo on 18/3/29.
 */
public class Question03 {
    public static void main(String[] args) {


        for (int i = 100; i < 1000; i++) {
            int num = i;
            int hundreds = num / 100;
            num %= 100;
            int tens = num / 10;
            num %= 10;
            if (i == hundreds * hundreds * hundreds + tens * tens * tens + num * num * num) {
                System.out.println(i);
            }
        }

    }

}